<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>xilsecure: XilSecure RSA Client APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">xilsecure
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;"
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__xsecure__rsa__client__apis.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">XilSecure RSA Client APIs</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga0a31b3c51ef35089c7f0d9f0b6218731"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__rsa__client__apis.html#ga0a31b3c51ef35089c7f0d9f0b6218731">XSECURE_RSA_SIZE</a>&#160;&#160;&#160;(512U)</td></tr>
<tr class="memdesc:ga0a31b3c51ef35089c7f0d9f0b6218731"><td class="mdescLeft">&#160;</td><td class="mdescRight">512 bytes for 4096 bit data  <a href="#ga0a31b3c51ef35089c7f0d9f0b6218731">More...</a><br/></td></tr>
<tr class="separator:ga0a31b3c51ef35089c7f0d9f0b6218731"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3889ef0cd21d5b09ffa60be16ce88140"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__rsa__client__apis.html#ga3889ef0cd21d5b09ffa60be16ce88140">XSECURE_PRIME_FACTOR_P_SIZE</a>&#160;&#160;&#160;(256U)</td></tr>
<tr class="memdesc:ga3889ef0cd21d5b09ffa60be16ce88140"><td class="mdescLeft">&#160;</td><td class="mdescRight">256 bytes size of first prime factor(P)  <a href="#ga3889ef0cd21d5b09ffa60be16ce88140">More...</a><br/></td></tr>
<tr class="separator:ga3889ef0cd21d5b09ffa60be16ce88140"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaea22c8d9e551a75beb81099592d63ada"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__rsa__client__apis.html#gaea22c8d9e551a75beb81099592d63ada">XSECURE_PRIME_FACTOR_Q_SIZE</a>&#160;&#160;&#160;(256U)</td></tr>
<tr class="memdesc:gaea22c8d9e551a75beb81099592d63ada"><td class="mdescLeft">&#160;</td><td class="mdescRight">256 bytes size of first prime factor(Q)  <a href="#gaea22c8d9e551a75beb81099592d63ada">More...</a><br/></td></tr>
<tr class="separator:gaea22c8d9e551a75beb81099592d63ada"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a31b3c51ef35089c7f0d9f0b6218731"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__rsa__client__apis.html#ga0a31b3c51ef35089c7f0d9f0b6218731">XSECURE_RSA_SIZE</a>&#160;&#160;&#160;(512U)</td></tr>
<tr class="memdesc:ga0a31b3c51ef35089c7f0d9f0b6218731"><td class="mdescLeft">&#160;</td><td class="mdescRight">512 bytes for 4096 bit data  <a href="#ga0a31b3c51ef35089c7f0d9f0b6218731">More...</a><br/></td></tr>
<tr class="separator:ga0a31b3c51ef35089c7f0d9f0b6218731"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaad026ed28e47be9b59e0444deb3af85a"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__rsa__client__apis.html#gaad026ed28e47be9b59e0444deb3af85a">XSecure_RsaPrivateDecrypt</a> (XSecure_ClientInstance *InstancePtr, const u64 KeyAddr, const u64 InDataAddr, const u32 Size, const u64 OutDataAddr)</td></tr>
<tr class="memdesc:gaad026ed28e47be9b59e0444deb3af85a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to Perform RSA decryption with private key.  <a href="#gaad026ed28e47be9b59e0444deb3af85a">More...</a><br/></td></tr>
<tr class="separator:gaad026ed28e47be9b59e0444deb3af85a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2a6250efae11b0bdbfe22e6642dedf4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__rsa__client__apis.html#gaf2a6250efae11b0bdbfe22e6642dedf4">XSecure_RsaPublicEncrypt</a> (XSecure_ClientInstance *InstancePtr, const u64 KeyAddr, const u64 InDataAddr, const u32 Size, const u64 OutDataAddr)</td></tr>
<tr class="memdesc:gaf2a6250efae11b0bdbfe22e6642dedf4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to Perform RSA encryption with public key.  <a href="#gaf2a6250efae11b0bdbfe22e6642dedf4">More...</a><br/></td></tr>
<tr class="separator:gaf2a6250efae11b0bdbfe22e6642dedf4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8bdc7108615c89806dae54dd56f428d7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__xsecure__rsa__client__apis.html#ga8bdc7108615c89806dae54dd56f428d7">XSecure_RsaSignVerification</a> (XSecure_ClientInstance *InstancePtr, const u64 SignAddr, const u64 HashAddr, const u32 Size)</td></tr>
<tr class="memdesc:ga8bdc7108615c89806dae54dd56f428d7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sends IPI request to Perform RSA sign verification.  <a href="#ga8bdc7108615c89806dae54dd56f428d7">More...</a><br/></td></tr>
<tr class="separator:ga8bdc7108615c89806dae54dd56f428d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="ga3889ef0cd21d5b09ffa60be16ce88140"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_PRIME_FACTOR_P_SIZE&#160;&#160;&#160;(256U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>256 bytes size of first prime factor(P) </p>

</div>
</div>
<a class="anchor" id="gaea22c8d9e551a75beb81099592d63ada"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_PRIME_FACTOR_Q_SIZE&#160;&#160;&#160;(256U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>256 bytes size of first prime factor(Q) </p>

</div>
</div>
<a class="anchor" id="ga0a31b3c51ef35089c7f0d9f0b6218731"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_RSA_SIZE&#160;&#160;&#160;(512U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>512 bytes for 4096 bit data </p>

</div>
</div>
<a class="anchor" id="ga0a31b3c51ef35089c7f0d9f0b6218731"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define XSECURE_RSA_SIZE&#160;&#160;&#160;(512U)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>512 bytes for 4096 bit data </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaad026ed28e47be9b59e0444deb3af85a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_RsaPrivateDecrypt </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>KeyAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>InDataAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>Size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>OutDataAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to Perform RSA decryption with private key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">KeyAddr</td><td>Address of the Key </td></tr>
    <tr><td class="paramname">InDataAddr</td><td>Address of the data which has to be decrypted </td></tr>
    <tr><td class="paramname">Size</td><td>Key size in bytes, Input size also should be same as key size mentioned. Inputs supported are<ul>
<li>XSECURE_RSA_4096_KEY_SIZE,</li>
<li>XSECURE_RSA_2048_KEY_SIZE</li>
<li>XSECURE_RSA_3072_KEY_SIZE </li>
</ul>
</td></tr>
    <tr><td class="paramname">OutDataAddr</td><td>Address of the buffer where resultant decrypted data to be stored</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS If the update is successful</li>
<li>XST_FAILURE If there is a failure </li>
</ul>
</dd></dl>
<p>Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid</p>
<p>Link shared memory of size RsaParams to RsaParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_RsaDecrypt API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36aca1106e4714531244afe2851830e51af1b">XSECURE_API_RSA_PRIVATE_DECRYPT</a>, <a class="el" href="group__xsecure__common__apis.html#ga4dc28d692c8e56b1837e73a956ddec26">XSecure_DCacheFlushRange</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

<p>Referenced by <a class="el" href="xsecure_8h.html#a55d3f721f0d915165ee23ead0d021857">XSecure_RsaCore()</a>, and <a class="el" href="group__xsecure__kat__server__apis.html#gaff9e6accc6dbd6922eda1a4d2322fdf6">XSecure_RsaPrivateDecryptKat()</a>.</p>

</div>
</div>
<a class="anchor" id="gaf2a6250efae11b0bdbfe22e6642dedf4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_RsaPublicEncrypt </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>KeyAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>InDataAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>Size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>OutDataAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to Perform RSA encryption with public key. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">KeyAddr</td><td>Address of the Key </td></tr>
    <tr><td class="paramname">InDataAddr</td><td>Address of the data which has to be encrypted with public key </td></tr>
    <tr><td class="paramname">Size</td><td>Key size in bytes, Input size also should be same as key size mentioned. Inputs supported are<ul>
<li>XSECURE_RSA_4096_KEY_SIZE,</li>
<li>XSECURE_RSA_2048_KEY_SIZE</li>
<li>XSECURE_RSA_3072_KEY_SIZE </li>
</ul>
</td></tr>
    <tr><td class="paramname">OutDataAddr</td><td>Address of the buffer where resultant decrypted data to be stored</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS If encryption was successful</li>
<li>XST_FAILURE If there is a failure </li>
</ul>
</dd></dl>
<p>Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid</p>
<p>Link shared memory of size RsaParams to RsaParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_RsaEncrypt API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36aca64400e366afc1fa1c96b991d9061dc50">XSECURE_API_RSA_PUBLIC_ENCRYPT</a>, <a class="el" href="group__xsecure__common__apis.html#ga4dc28d692c8e56b1837e73a956ddec26">XSecure_DCacheFlushRange</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

<p>Referenced by <a class="el" href="xsecure_8h.html#a17ffcc1179ee379019196d122403f8dc">XSecure_DataAuth()</a>, <a class="el" href="xsecure_8h.html#a55d3f721f0d915165ee23ead0d021857">XSecure_RsaCore()</a>, <a class="el" href="group__xsecure__kat__server__apis.html#gac4ab51058f2ef18bcb5a1aedf95b83d8">XSecure_RsaPublicEncryptKat()</a>, and <a class="el" href="xsecure_8h.html#ae9ccb5dc051bf792ce88b8f3fe376122">XSecure_SpkAuthentication()</a>.</p>

</div>
</div>
<a class="anchor" id="ga8bdc7108615c89806dae54dd56f428d7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XSecure_RsaSignVerification </td>
          <td>(</td>
          <td class="paramtype">XSecure_ClientInstance *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>SignAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u64&#160;</td>
          <td class="paramname"><em>HashAddr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const u32&#160;</td>
          <td class="paramname"><em>Size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sends IPI request to Perform RSA sign verification. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>Pointer to the client instance </td></tr>
    <tr><td class="paramname">SignAddr</td><td>Address of the buffer which holds the decrypted RSA signature. </td></tr>
    <tr><td class="paramname">HashAddr</td><td>Address of the HashAddr which has the hash calculated on the data to be authenticated </td></tr>
    <tr><td class="paramname">Size</td><td>Length of Hash used For SHA3 it should be 48 bytes</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS If decryption was successful</li>
<li>XST_FAILURE In case of mismatch </li>
</ul>
</dd></dl>
<p>Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid</p>
<p>Link shared memory of size SignParams to SignParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.</p>
<p>Send an IPI request to the PLM by using the CDO command to call XSecure_RsaSignVerify API and returns the status of the IPI response.</p>

<p>References <a class="el" href="group__xsecure__common__apis.html#gga48921cbba3a5713caf7d975bedbe36aca912e735422332f673c7eac208ba3927e">XSECURE_API_RSA_SIGN_VERIFY</a>, <a class="el" href="group__xsecure__common__apis.html#ga4dc28d692c8e56b1837e73a956ddec26">XSecure_DCacheFlushRange</a>, and <a class="el" href="group__xsecure__mailbox__apis.html#ga6ac5f0da32dd8fb5fcd15a7e65b492bb">XSecure_ProcessMailbox()</a>.</p>

<p>Referenced by <a class="el" href="xsecure_8h.html#a17ffcc1179ee379019196d122403f8dc">XSecure_DataAuth()</a>, and <a class="el" href="xsecure_8h.html#ae9ccb5dc051bf792ce88b8f3fe376122">XSecure_SpkAuthentication()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
